package com.prs.crm.domain.ca.work;


import java.util.Date;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
import com.prs.crm.domain.flow.WorkFlow;
import com.prs.crm.domain.flow.WorkFlowInstance;
import com.prs.crm.domain.hr.Person;

/**
 * @author YangHao
 * @E-Mail:450098606@qq.com
 * @qq:450098606
 * @version 创建时间：2012-3-28 14:46:06 物品领用
 */
@Entity
@Table(name = "ca_articleTook")
public class ArticleTook extends BaseEntity {

	private static final long serialVersionUID = -8755077558328252521L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	/**
	 * 单号
	 */
	private String at_billNumber;
	/**
	 * 领用申请人
	 */
	@ManyToOne
	private Person person;
	private Integer tookNum;
	/**
	 * 申请日期
	 */
	private Date at_applyDate;
	/**
	 * 领用部门
	 */
	@ManyToOne
	private TookDepartment at_tookDepartment;
	/**
	 * 审批状态
	 */
	private Integer at_examaineState;// 0表示未提交1审批中2已完成3撤销申请4未通过
	/**
	 * 审批人
	 */
	private String at_examainPerson;
	/**
	 * 审批步骤
	 */
	private Integer at_examinProcedure;// 0 1申请者2部门经理3总经理4财务经理5出纳
	
	@OneToMany(fetch=FetchType.LAZY,mappedBy="tp_articleTook")
	private Set<TookParticular> tookPar;

	@ManyToOne
	private DemandInventory demands;
	
	private String appName;
	
	private String type;
	@ManyToOne
	private WorkFlowInstance workFlowInstance;
	
	
	@ManyToOne
	private WorkFlow workFlow;
	/**
	 * 设置是否显示
	 * 1：显示 
	 */
	private String showstate;
	private String personAppProcess;
	private Integer personAppState;
	
	public String getPersonAppProcess() {
		return personAppProcess;
	}

	public void setPersonAppProcess(String personAppProcess) {
		this.personAppProcess = personAppProcess;
	}

	public Integer getPersonAppState() {
		return personAppState;
	}

	public void setPersonAppState(Integer personAppState) {
		this.personAppState = personAppState;
	}

	public WorkFlow getWorkFlow() {
		return workFlow;
	}

	public void setWorkFlow(WorkFlow workFlow) {
		this.workFlow = workFlow;
	}

	public String getShowstate() {
		return showstate;
	}

	public void setShowstate(String showstate) {
		this.showstate = showstate;
	}

	public Integer getTookNum() {
		return tookNum;
	}

	public void setTookNum(Integer tookNum) {
		this.tookNum = tookNum;
	}

	public WorkFlowInstance getWorkFlowInstance() {
		return workFlowInstance;
	}

	public void setWorkFlowInstance(WorkFlowInstance workFlowInstance) {
		this.workFlowInstance = workFlowInstance;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach; 
	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public Attachment getAttach() {
		return attach;
	}

	public void setAttach(Attachment attach) {
		this.attach = attach;
	}

	public DemandInventory getDemands() {
		return demands;
	}

	public void setDemands(DemandInventory demands) {
		this.demands = demands;
	}

	public Set<TookParticular> getTookPar() {
		return tookPar;
	}

	public void setTookPar(Set<TookParticular> tookPar) {
		this.tookPar = tookPar;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getAt_billNumber() {
		return at_billNumber;
	}

	public void setAt_billNumber(String atBillNumber) {
		at_billNumber = atBillNumber;
	}
	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

	public Date getAt_applyDate() {
		return at_applyDate;
	}

	public void setAt_applyDate(Date atApplyDate) {
		at_applyDate = atApplyDate;
	}

	public TookDepartment getAt_tookDepartment() {
		return at_tookDepartment;
	}

	public void setAt_tookDepartment(TookDepartment atTookDepartment) {
		at_tookDepartment = atTookDepartment;
	}
	public String getAt_examainPerson() {
		return at_examainPerson;
	}

	public void setAt_examainPerson(String atExamainPerson) {
		at_examainPerson = atExamainPerson;
	}

	public Integer getAt_examaineState() {
		return at_examaineState;
	}

	public void setAt_examaineState(Integer atExamaineState) {
		at_examaineState = atExamaineState;
	}

	public Integer getAt_examinProcedure() {
		return at_examinProcedure;
	}

	public void setAt_examinProcedure(Integer atExaminProcedure) {
		at_examinProcedure = atExaminProcedure;
	}

}
